<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <!--<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />-->
    <meta name="renderer" content="webkit"/>
    <title></title>
    <link rel="stylesheet" href="__CSS__/pintuer.css"/>
    <link rel="stylesheet" href="__CSS__/admin.css"/>
    <link rel="stylesheet" href="__CSS__/jquery.datetimepicker.css"/>
    <script src="__JS__/jquery-1.8.3.min.js"></script>
    <script src="__JS__/jquery.js"></script>
    <script src="__JS__/pintuer.js"></script>
    <link href="__JS__/bootstrap-3.3.4.css" rel="stylesheet"/>
    <script src="__JS__/layer/layer.js"></script>
</head>
<body>
<div class="panel admin-panel">
    <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>增加特产内容</strong></div>
    <div class="body-content">
        <form method="post" class="form-x" action={:url("Specialty/graph_index")} enctype="multipart/form-data" id="form">
            <div class="form-group">
                <div class="label">
                    <label>特产名字：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="" name="name" id="merchant_name" data-validate="required:请输入内容" />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>特产图片：</label>
                </div>
                <div class="field" style="position: relative;">
                    <input type="file" onchange="preview0(this)"  name="img[0]" multiple="multiple" style="display: inline-block"/>
                </div>
                <div class="label">
                    <label>景点详情图：</label>
                </div>
                <div class="field" style="position: relative;">
                    <input type="file" onchange="preview1(this)"  name="img[1]"  style="display: inline-block"/>
                    <input type="file" onchange="preview2(this)" name="img[2]" style="display: inline-block"/>
                    <input type="file" onchange="preview3(this)" name="img[3]" style="display: inline-block"/>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>特产价格：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" name="amounts" id="phone" value=""  />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>发布日期：</label>
                </div>
                <div class="field">
                    <input type="datetime" class="input w50" name="time" id="datetimepicker_mask" value=""  />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>特产描述：</label>
                </div>
                <div class="field">
                    <textarea class="input" name="introduce" id="merchant_introduction"></textarea>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>特产地址：</label>
                </div>
                <div class="field">
                    <div class="docs-methods">
                        <div id="distpicker">
                                <span>
                                    <div class="form-group" id="province">
                                        <label class="sr-only" for="province">Province</label>
                                        <select class="form-control" name="address_t[0]"></select>
                                    </div>
                                    <div class="form-group" id="city">
                                        <label class="sr-only" for="city">City</label>
                                        <select class="form-control" name="address_t[1]"></select>
                                    </div>
                                    <div class="form-group" id="district">
                                        <label class="sr-only" for="district">District</label>
                                        <select class="form-control" name="address_t[2]"></select>
                                    </div>
                              </span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>详细地址：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="" name="address" id="merchant_detailed" data-validate="required:请输入内容" />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <input type="submit" class="button bg-main icon-check-square-o" id="admin_add_tj" value="提交">
                </div>
            </div>
        </form>
    </div>
</div>
<!--<script src="http://www.jq22.com/jquery/1.11.1/jquery.min.js"></script>-->
<!--<script src="http://www.jq22.com/jquery/bootstrap-3.3.4.js"></script>-->
<script src="__JS__/distpicker.data.js"></script>
<script src="__JS__/distpicker.js"></script>
<script src="__JS__/main.js"></script>
<script src="__JS__/jquery.datetimepicker.js"></script>
</body></html>
<script>
    $('#datetimepicker_mask').datetimepicker({
//        mask:'9999/19/39 29:59'
    });
    var url = "{:url('Index/index')}";


    //图片上传预览
    function preview(file)
    {
        var prevDiv = document.getElementById('preview');
        if (file.files && file.files[0])
        {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '"  width="100px"height="100px"/>';
            }
            reader.readAsDataURL(file.files[0]);
        }
        else
        {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }

    function preview1(file)
    {
        var prevDiv = document.getElementById('preview1');
        if (file.files && file.files[0])
        {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '"  width="100px"height="100px"/>';
            }
            reader.readAsDataURL(file.files[0]);
        }
        else
        {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }
    function preview2(file)
    {
        var prevDiv = document.getElementById('preview2');
        if (file.files && file.files[0])
        {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '"  width="100px"height="100px"/>';
            }
            reader.readAsDataURL(file.files[0]);
        }
        else
        {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }
    function preview3(file)
    {
        var prevDiv = document.getElementById('preview3');
        if (file.files && file.files[0])
        {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '"  width="100px"height="100px"/>';
            }
            reader.readAsDataURL(file.files[0]);
        }
        else
        {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }

</script>